import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup} from "@angular/forms";
import {HttpClient} from "@angular/common/http";

@Component({
  selector: 'app-edit-user',
  templateUrl: './edit-user.component.html',
  styleUrls: ['./edit-user.component.css']
})
export class EditUserComponent implements OnInit {
  validateForm: FormGroup

  constructor(private http: HttpClient,
              private fb: FormBuilder,) {
    this.validateForm = this.fb.group({
      id: [],
      userId: [],
      name: [],
      age: [],
      email: [],
      gender: [],
    })
  }

  ngOnInit(): void {
  }

  submitForm() {
    this.http.post(`/user/updatePersonalDetail`, this.validateForm.getRawValue()).subscribe(() => {
      //this.service.success(`保存成功`)
    })
  }

}
